package com.itheima.dao;

import com.itheima.pojo.Role;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface RoleMapper extends Mapper<Role> {

    @Select("select uid,role_name roleName,create_time createTime,update_time updateTime,status,summary,category_menu_uids categoryMenuUids from t_role where uid=#{roleUid}")
    Role findRoleByUid(@Param("roleUid") String roleUid);

    //获取用户被分配的角色数据
    @Select("select role_name roleName,summary,category_menu_uids categoryMenuUids,uid,status,create_time createTime,update_time updateTime from t_role where uid=#{roleUid}")
    Role findRoleByUid2(@Param("roleUid") String roleUid);

    //获取用户没有被分配的角色数据
    @Select("select role_name roleName,summary,category_menu_uids categoryMenuUids,uid,status,create_time createTime,update_time updateTime from t_role where uid!=#{roleUid}")
    List<Role>  findRoleListByUid3(@Param("roleUid") String roleUid);

}
